from pyecharts import options as opts
from pyecharts.charts import Bar

l1 = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期七', '星期日']
l2 = [100, 200, 300, 400, 500, 400, 300]
bar = (
    Bar()
        .add_xaxis(l1)
        .add_yaxis("l2", l2, category_gap=0, color='#FFFF00')
        .set_global_opts(title_opts=opts.TitleOpts(title="Bar-基本示例", subtitle="我是副标题"))
)
bar.render(path='4.设置柱状图间隔和颜色.html')
# category_gap:设置间隔
# color：设置柱状图颜色
